import lombok.NoArgsConstructor;

import java.util.Scanner;

@NoArgsConstructor
public class Game {
    private Board board;
    private Control control;

    public void initGame() {
        board = new Board();
        control = new Control();
        board.initBoard();
    }


    public void game() {
        Scanner scanner = new Scanner(System.in);
        while(true) {
            board.generateNewBlock();
            System.out.println("");
            board.showBoard();
            char op = scanner.next().charAt(0);
            if (op == 'w') {
                this.control.upMove(this.board);
            }
            if (op == 's') {
                this.control.downMove(this.board);
            }
            if (op == 'a') {
                this.control.leftMove(this.board);
            }
            if (op == 'd') {
                this.control.rightMove(this.board);
            }
            if (op == 'q') {
                break;
            }
        }
    }


    public void finishGame() {

    }
}
